package com.bingwang.sourcelearn.aop.interceptor;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author WangBing
 * @date 2023/11/19 12:14
 */
public class CglibInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        System.out.println("interceptor start");
        Object result = proxy.invokeSuper(obj, args);
        System.out.println("interceptor end");
        return result;
    }
}
